Machine learning-enhanced drug testing for simultaneous morphine and methadone detection in urinary biofluids

The simultaneous identification of drugs has considerable difficulties due to the intricate interplay of analytes and the interference present in biological matrices. In this study, we introduce an innovative electrochemical sensor that overcomes these hurdles, enabling the precise and simultaneous determination of morphine (MOR), methadone (MET), and uric acid (UA) in urine samples. The sensor harnesses the strategically adapted carbon nanotubes (CNT) modified with graphitic carbon nitride (g-C3N4) nanosheets to ensure exceptional precision and sensitivity for the targeted analytes. Through systematic optimization of pivotal parameters, we attained accurate and quantitative measurements of the analytes within intricate matrices employing the fast Fourier transform (FFT) voltammetry technique. The sensor’s performance was validated using 17 training and 12 test solutions, employing the widely acclaimed machine learning method, partial least squares (PLS), for predictive modeling. The root mean square error of cross-validation (RMSECV) values for morphine, methadone, and uric acid were significantly low, measuring 0.1827 µM, 0.1951 µM, and 0.1584 µM, respectively, with corresponding root mean square error of prediction (RMSEP) values of 0.1925 µM, 0.2035 µM, and 0.1659 µM. These results showcased the robust resiliency and reliability of our predictive model. Our sensor’s efficacy in real urine samples was demonstrated by the narrow range of relative standard deviation (RSD) values, ranging from 3.71 to 5.26%, and recovery percentages from 96 to 106%. This performance underscores the potential of the sensor for practical and clinical applications, offering precise measurements even in complex and variable biological matrices. The successful integration of g-C3N4-CNT nanocomposites and the robust PLS method has driven the evolution of sophisticated electrochemical sensors, initiating a transformative era in drug analysis.

employing g-C 3 N 4 -CNT-GCE, yielded a notably enhanced efficacy and stability for concurrent analytical detection objectives 47 .The fabricated sensors were subjected to comprehensive analyses, exploring their structural and electrochemical attributes.Among the various electrochemical techniques employed, FFT-SWV emerged as the most discerning approach, effectively enabling the quantitative assessment of the three targeted analytes.PLS, a widely embraced linear method within the domain of multivariate calibration methodologies, was employed to process the obtained data.The resulting calibration curve was successfully established, facilitating the accurate MOR, MET, and UA detection within real urine samples (Fig. 1).

Synthesis of g-C 3 N 4 and CNT-COOH and their combination
The synthesis of g-C 3 N 4 involved a polycondensation process utilizing melamine as its precursor, following a step-by-step procedure 48 .Initially, 10 g of melamine was placed in a crucible and heated in a muffle furnace at a controlled temperature of 550 °C for 4 h, with a gradual temperature increase at 2 °C per minute.The resulting sample was yellow and referred to as g-C 3 N 4 .
CNT-COOH was synthesized in an optimized two-step oxidation method 49 .In the first step, 0.1 g of CNT was placed in a 6 mL H 2 O 2 /H 2 SO 4 1:3 (v/v) solution before sonication at 60 °C for 2 h.After oxidation, the resulting mixture was diluted with deionized water, and the solid residue was separated through centrifugation at 4000 rpm.The obtained solid was washed three times with DI water and dried overnight at 50 °C.The oxidized CNT was further functionalized in the next step by adding 6 mL HNO 3 /H 2 SO 4 1:3 (v/v) to the solid and placed in an ice bath under stirring.The mixture was sonicated at 60 °C to achieve a homogenized suspension.Afterward, the suspension was centrifuged at 4000 rpm, and the solid was washed with deionized water until it reached a pH of 7. Finally, the as-prepared CNT-COOH sample was dried in a vacuum oven for 24 h at 65 °C to ensure complete drying and stabilization.Throughout the text, CNT-COOH is abbreviated as CNT.
To prepare the nanocomposite of g-C 3 N 4 -CNT; first, a suspension of 5 mL containing 1 mg/mL of CNT was mixed with another 5 mL suspension containing 1 mg/mL of g-C 3 N 4 .To achieve homogeneity, 10 mL of isopropanol was added to this mixture before subjecting it to sonication.Subsequently, the homogenized suspension was transferred to a 40 mL stainless steel autoclave.Inside the autoclave, the temperature was gradually increased at 2 °C per minute until reaching 120 °C, where it was maintained for 48 h.After the solvothermal treatment, the resulting nanocomposite samples were washed three times with DI water and dried in a vacuum oven at 80 °C for 12 h.This process facilitated the transformation of g-C 3 N 4 and CNT into the desired g-C 3 N 4 -CNT nanocomposite through a solvothermal self-assembly process 49 , as illustrated in Fig. S1.Subsequently, a suspension of g-C 3 N 4 -CNT with a concentration of 3 mg/mL in water was subjected to sonication for 15 min to achieve a homogenous suspension.Finally, a precise volume of 2 µL of the suspension was evenly deposited onto the surface of the GC electrode.The deposited suspension was then dried under an infrared (IR) lamp.

Electrochemical characterization
All electrochemical experiments were conducted using a μStat-i 400s portable Potentiostat/Galvanostat/Impedance Analyzer (Metrohm Dropsens, Netherlands), controlled by a personal computer equipped with DropView 8400 software.The device features a three-electrode system comprising a 2 mm diameter glassy carbon electrode (GCE) as the working electrode, a platinum wire as the auxiliary electrode, and an Ag/AgCl electrode as the reference electrode.Electrochemical Impedance Spectroscopy (EIS) was conducted within a solution comprising 5 mM Potassium ferricyanide and 0.1 M potassium chloride, totaling 10 mL in volume, by applying a frequency from 100 mHz to 100 kHz.The applied DC potential was 50 mV, and the applied AC potential amplitude was 10 mV.The quantitative electrochemical assessment of MOR, MET, and UA was executed utilizing a customdesigned Autolab electrochemical system equipped with a three-electrode cell configuration.FFT-SWV is an advanced electrochemical technique derived from the SWV method, employing the discrete FFT approach for background subtraction and two-dimensional integration of the electrode response to analyze chemical compounds.Detailed insights into this methodology can be accessed through Fig. S5, along with the corresponding explanation provided in the Supplementary Information (SI) file under the section labeled SI-S2.

Structural characterization
X-ray photoelectron spectroscopy (XPS) with a monochromatic A1 Kα radiation source was employed to inspect the valence of the elements as well as their composition.Transmission electron microscopy (TEM) and highresolution transmission electron microscopy (HRTEM) were executed on a Philips CM30 200 kV and HR-TEM FEI TECNAI F20 instrument.Scanning electron microscopy (SEM) equipped with TeScan-Mira III EDX system and field emission scanning electron microscopy (FESEM) was utilized for morphological and elemental analysis.The UV-vis diffuse reflectance spectroscopy (DRS) (Scinco 4100) characterized the optical properties of the synthesized materials.Photoluminescence (PL) spectra were obtained by Perkin Elmer LS55 luminescence.A Metrohm 744 pH meter was employed for pH adjustments, and an Ultrasonic cleaner was used to homogenize the samples.

Multivariate calibration
The PLS method is a statistical technique used for building predictive models between two sets of variables, usually denoted as X and Y.It is beneficial when there are many correlated predictor variables and works by reducing the dimensionality of the X space and finding the relationship with the Y space.
The basic formula for the PLS algorithm can be represented as: where Y is the matrix of dependent variables (responses or outputs), X is the matrix of independent variables (predictors or inputs), B is the matrix of regression coefficients that describes the relationship between X and Y, and E is the matrix of residuals or errors (the difference between the observed and predicted values).For further elucidation of the PLS method, additional details are accessible in SI-S3.

Results and discussion
Surface characterization of g-C 3 N 4 -CNT The morphology analysis of g-C 3 N 4 and g-C 3 N 4 -CNT nanocomposite was conducted using FESEM and HRTEM.
In the FESEM image of g-C 3 N 4 (Fig. 2a), a plate-like structure with a thickness of less than 100 nm is prominently visible.Transitioning to the FESEM image of g-C 3 N 4 -CNT (Fig. 2b), the placement of CNTs amidst the g-C 3 N 4 sheets becomes evident, confirming the successful synthesis of the composite.The TEM image of the g-C 3 N 4 -CNT composite depicted in Fig. 2c illustrates the homogeneous distribution of CNTs within the g-C 3 N 4 sheets.Furthermore, Fig. 2d presents the HRTEM image, revealing distinct crystal planes of g-C 3 N 4 (002) and CNT (002).The corresponding lattice spacing for these planes is measured at 0.325 and 0.340 nm, respectively, under previous findings 50,51 .The HRTEM image underscores a compatible interaction between g-C 3 N 4 and CNT, forming the g-C 3 N 4 -CNT composite.The pronounced quality of the composite synthesis is evidenced by the clarity observed in the HRTEM image.
Regarding elemental analysis, the Energy-dispersive X-ray (EDX) spectrum of the g-C 3 N 4 -CNT composite has been presented and can be observed in Fig. S2a.Within this EDX spectrum, the presence of three distinct peaks corresponding to carbon, nitrogen, and oxygen is clearly discernible within the nanocomposite.Notably, the relative sizes of these peaks reveal the qualitative distribution of carbon, nitrogen, and oxygen elements within the synthesized composite.The relatively prominent carbon peak compared to the nitrogen peak and the nitrogen peak compared to the oxygen peak provide qualitative insights into the elemental ratios present within the composite structure.Furthermore, in order to comprehensively elucidate the interplay between CNT and g-C 3 N 4 , the XPS spectrum of the g-C 3 N 4 -CNT composite was procured.The collective XPS spectrum of this composite is illustrated in Fig. S2b, manifesting the distinct presence of carbon, nitrogen, and oxygen elements.Evident peaks emerge at binding energies of 289.5 eV, 404.7 eV, and 537.7 eV, corresponding to C1s, N1s, and O1s, respectively.More intricate scrutiny is warranted; thus, the deconvoluted peaks of the carbon and nitrogen components are delineated in Fig. 2e and f.Within the C1s spectrum, four distinct peaks are localized at binding energies of 289.1 eV, 290.1 eV, 293.4 eV, and 294.1 eV, denoting the C = C bond, C-O bond, sp 2 carbon in g-C 3 N 4 , and COOH-carbon, respectively 52 .Delving into the N1s deconvolution, a quartet of peaks emerges.The peak situated at 402.7 eV corresponds to N atoms (sp 2 bond) within triazine rings (C-N=C), indicating an interaction with CNT.
Similarly, the peak at 404.1 eV signifies sp 2 -bonded N atoms within triazine rings (C-N=C).The third peak, at 405.4 eV, is attributable to N atoms in N-(C) 3 .Lastly, a minor intensity peak at 410.1 eV signifies positively charged CN heterocycles and cyano groups, a result of protonation of g-C 3 N 4 through interaction with carboxylic acid groups in CNT 53 .
These findings substantiate a robust interaction between g-C 3 N 4 and CNT within the g-C 3 N 4 -CNT composite.This interaction manifests along two distinct pathways: the first involves π-π interactions between the conjugated (1) www.nature.com/scientificreports/triazine group in g-C 3 N 4 and the graphene units in CNT, while the second stems from electrostatic interactions between COO groups of CNT and the positive charge on g-C 3 N 4 52 .The assessment of the absorption spectra for both g-C 3 N 4 and g-C 3 N 4 -CNT samples was conducted by UV-V is spectroscopy.Illustrated in Fig. 2g, the spectrum of g-C 3 N 4 unveils two strong absorption peaks at 264 nm and 380 nm, allocated to π → π* and n → π* electronic transitions, correspondingly 54 .Analogously, the absorption profile of the g-C 3 N 4 -CNT nanocomposite exhibits two peaks akin to those of g-C 3 N 4 ; however, the absorption intensity of the nanocomposite is augmented.This heightened absorption intensity can be rationalized through the π-π interaction between g-C 3 N 4 and CNT, contributing to this enhancement 49 .Fluorescence spectroscopy is An alternative analytical approach to probe the bond formation between g-C 3 N 4 and CNT.Illustrated in Fig. 2h, g-C 3 N 4 demonstrates a robust emission peak at 470 nm.Upon the incorporation of CNT into g-C 3 N 4 , resulting in the g-C 3 N 4 -CNT nanocomposite, the intensity of fluorescence emission compared to g-C 3 N 4 decreased significantly.This phenomenon underpins the significant π-π stacking interaction between g-C 3 N 4 and CNT.This interaction contributes to shifting the Highest Occupied Molecular Orbital (HOMO) level of g-C 3 N 4 to lower energy levels, leading to the quenching of fluorescence 49,55 .

Evaluation of electrochemical properties through EIS and cyclic voltammetry (CV)
EIS was employed to determine the electron transfer rates across distinct modified electrodes.The resistance that electrons show against transfer (R et ) is derived from the dielectric and insulating properties of the electrode/ electrolyte interface 56 .The Nyquist diagram in Fig. S3 illustrates the GCE, CNT-GCE, and g-C 3 N 4 -CNT-GCE configurations within a 5 mM ferrocyanide and 0.1 M potassium chloride solution.For the unmodified GCE, R et measured at approximately 301.17 Ω. Upon introducing a coating of CNT onto the electrode surface, R et declined to around 98.32 Ω.Finally, with the electrode modified with g-C 3 N 4 -CNT, the R et value further diminished to 86.31 Ω-significantly lower than the other two electrodes.The insights drawn from the EIS results suggest that the successful electrode coating involved a composite with heightened conductivity and decreased electron transfer resistance.
CV was employed to investigate the electrochemical behavior of MOR, MET, and UA on the surfaces of CNT-GCE and g-C 3 N 4 -CNT-GCE electrodes.The cyclic voltammograms of fabricated electrodes were obtained in a 0.1 M phosphate buffer solution (pH of 8) at the scan rate of 0.1 V/s, with the potential range spanning from 0 to 1.1 V.The CV profile of the buffer blank system in the presence of g-C 3 N 4 -CNT-GCE is shown in Fig. S4.These results confirm the absence of electrochemical peaks in the absence of analytes.Figure 3a-d illustrate the CV profiles of CNT-GCE and g-C 3 N 4 -CNT-GCE in the presence of 5 μM MOR, MET, and UA.These figures show that anodic peaks manifest for both the modified electrodes.The anodic peaks corresponding to MOR, i and ii, on the CNT-GCE, emerge at the potentials of 0.42 and 0.83 V.At the same time, on the g-C 3 N 4 -CNT-GCE, they occur at slightly lower potentials of 0.39 and 0.81 V and higher peak currents compared to those on the CNT-GCE.
The observed shift of the anodic peaks of MOR towards more negative potentials accompanied by the augmented current in the presence of the g-C 3 N 4 -CNT-GCE relative to CNT-GCE, underscore the electrocatalytic traits of the g-C 3 N 4 -CNT composite in the electrochemical quantification of MOR. Figure 3b's MET analysis shows distinct peaks at 0.79 V for CNT-GCE and 0.73 V for g-C 3 N 4 -CNT-GCE, with the latter exhibiting increased peak currents due to improved electrocatalytic properties.Figure 3c's UA analysis reveals peaks at around 0.33 V for CNT-GCE and 0.34 V for g-C 3 N 4 -CNT-GCE, with a notable current increase in the latter, attributed to its higher conductivity and electrocatalytic efficiency.Concluding this analysis, the simultaneous presence of MOR, MET, and UA was examined using both electrode configurations, as indicated in Fig. 3d.Significantly, the observed overlap between the anodic peak of UA and the initial anodic peak of MOR (i) on the g-C 3 N 4 -CNT-GCE is more pronounced than on the CNT-GCE.This phenomenon is attributed to the significant shift of the first anodic peak of MOR towards more negative potentials, relative to UA, in the presence of the g-C 3 N 4 -CNT composite.
Conversely, the enhancement observed in the anodic current for both UA and MOR stems from including the g-C 3 N 4 -CNT composite.The capacity to segregate these compounds can be achieved based on the extent of overlapping and the increase in current brought about by multivariable calibration methodologies.Moreover, the second anodic peak (ii) of MOR and the electrochemical peak corresponding to MET exhibit a pronounced overlap in the presence of both electrode configurations.Nonetheless, it should be noted that when the g-C 3 N 4 -CNT-GCE is utilized, the composite results in a broader peak width for the MOR and MET mixture compared to the CNT-GCE.
It is analyzing the single-component curves presented in Fig. 3a and b, it is evident that the potential discrepancy between the second MOR peak and the anodic peak of MET is 80 mV in the presence of the g-C 3 N 4 -CNT-GCE, while it stands at 40 mV in the presence of the CNT-GCE.These observations indicate a reduced overlap of the two anodic peaks when utilizing the g-C 3 N 4 -CNT composite.

Optimization of pH, accumulation time, and FFT-SWV variables
The pH of the measurement solution stands as a critical determinant in electrochemical analyses, primarily due to the influential roles that groups containing OH − and H + play in most electrochemical reactions.The effect of pH on the current of the electrochemical reactions of MOR, MET, and UA was assessed at a concentration of 5 µM in phosphate buffer.As depicted in Fig. 4a, MOR, MET and UA peaks exhibited an increase in current with rising pH values to 8.However, at pH values of 9 and 10, a slight decrease in the responses was observed.Also, a significant response was not observed for the MET and second peak of MOR at pH less than 6, UA at pH less than 5, and the first peak of MOR at pH less than 4. Conclusively, a pH of 8 was determined for further experiments, as it yielded the maximum response.To explore the effect of accumulation on the efficiency of the electrochemical measurements of MOR, MET, and UA, a 5 µM solution of the samples was subjected to analysis (Fig. 4b).The measurements were conducted in 30 s intervals within 0 to 150 s.Fluctuations in the currents of MOR and MET persisted until 120 s, whereas it sustained the same quantity up until 150 s.In the case of UA, variations endured until 90 s before stabilizing.Consequently, the optimum measurement time of 120 s was selected for MOR, MET, and UA analyses.
Amplitude and frequency constitute pivotal parameters within the framework of FFT-SWV.Amplitude signifies the magnitude of potential disparity between the maximal positive and negative values within the squarewave, a parameter critically involved in determining sensitivity and resolution in the FFT-SWV method.Amplifying the amplitude generally enhances the sensitivity and peak current of the voltammetric response, as it provides a greater driving force for redox reactions at the electrode interface.However, excessive amplification could lead to elevated background currents and noise, potentially reducing signal-to-noise ratio and impeding resolution.Striking the optimal balance between sensitivity and resolution mandates judicious selection of amplitude.
Frequency influences the analysis speed and the diffusional transport of analytes to the electrode surface.Elevating frequency quickens analysis by completing more potential cycles in a shorter span.Higher frequencies can also mitigate capacitive background currents, boosting signal-to-noise ratio and lowering detection limits.Nevertheless, extremely high frequencies might curtail the diffusion time of analytes to the electrode, causing reduced peak currents and sensitivity.The choice of optimal frequency hinges on the specific system under scrutiny and the desired trade-off between speed, sensitivity, and signal-to-noise ratio.As a result, amplitude and frequency profoundly influenced square-wave voltammetry, with their optimal values contingent upon the specific electrochemical system.The meticulous tuning of these parameters is imperative for maximizing the FFT-SWV technique's sensitivity, resolution, and speed.www.nature.com/scientificreports/frequency range of 177 to 256 Hz and the potential range of 15 to 25 mV, followed by a decline until reaching a frequency of 564 Hz and a potential range of 30, likely attributed to slower electrochemical reaction kinetics.Additionally, as depicted in Fig. 4f, the electrochemical peak current of UA escalated with increasing frequency from 88 to 256 Hz and amplitude from 5 to 10 mV.The response remained consistent between the frequency of 256 to 443 and the amplitude of 10 to 20 mV, followed by a subsequent decline.Based on these findings, the frequency of 256 Hz and amplitude of 20 mV were identified as the optimal values for these two parameters in implementing the FFT-SWV technique.

Simultaneous measurement of MOR, MET, and UA
To enhance a model for the simultaneous analysis of MOR, MET, and UA by the PLS method and to achieve a comprehensive understanding of the linear range of the g-C 3 N 4 -CNT-GCE electrochemical sensor, individual univariate calibrations were conducted for each compound (Fig. 5a-c).The resulting analytical information, including the dynamic linear range (DLR), the limit of detection (LOD), and the limit of quantitation (LOQ) are presented in Table 1.The LOD and LOQ follow equations 3S b /m and 10S b /m, respectively, in which S b is the blank standard deviation and m is the slope of the calibration curve.Upon optimizing the operational parameters of the developed sensor and determining the analytical parameters via univariate calibration, a set of mixing solutions, comprising 17 training samples and 12 test samples, was selected and prepared (Table S1).Test and training solutions responses were recorded using the FFT-SWV technique.Subsequently, voltammograms, as depicted in Fig. 5d and e, were generated to serve as input data for www.nature.com/scientificreports/PLS modeling.The model's efficiency was evaluated across different latent variables (LVs), and ultimately, the first four LVs were deemed to represent the optimal condition for the PLS modeling process.Table S2 presents the root mean square errors of calibration (RMSEC) for MOR, MET, and UA, which stand at 0.1409, 0.1517, and 0.1143, respectively.The cross-validation procedure was conducted through the leaveone-out method, resulting in root mean square errors of cross-validation (RMSECV) for MOR, MET, and UA as 0.1825, 0.1951, and 0.1584, respectively.To validate the performance of the obtained multivariate calibration model for MOR, MET, and UA, a set of 10 test solutions was evaluated.These solutions encompassed diverse concentrations with the linear concentration range of the three analytes.The root mean squared error of prediction (RMSEP) values were calculated, yielding values of 0.1925, 0.2035, and 0.1659 for MOR, MET, and UA, respectively.Furthermore, the determination coefficient (R p 2 ) values for the prediction of MOR, MET, and UA were found to be 0.9632, 0.9545, and 0.9651, respectively.This variation in the performance of the model is attributed to the optimization of modeling for UA when compared to MOR, and, similarly, the enhanced modeling of MOR in comparison to MET.This differentiation is related to the minimal perturbation of the UA peak and the first peak of MOR.
The results of quantifying MOR, MET, and UA within both training and test datasets using PLS are depicted in Fig. 5f-h, respectively.These figures indicate reasonable agreement between the predicted and actual concentration levels of MOR, MET, and UA.A comparative analysis of the current approach against techniques delineated in the prior literature is provided in Table S3.

Interference study
In order to explore potential interferences within the concurrent quantification of MOR, MET, and UA within the intricate matrix of urine, 5 µM solutions of the analytes were employed under optimal conditions.The typical concentrations of some of these potential interferences in urine are as follows: Na + approximately 20,000 µM, K + within the range of 3,500 to 5,000 µM, Cu 2+ varying from 0.315 to 0.787 μM, Cr 2+ less than 0.002 μM, Glucose spanning from 0 to 800 µM, and ascorbic acid ranging from 280 to 560 µM.The tolerance threshold for each constituent was predetermined to entail a maximum ± 5% relative predictive deviation.This data demonstrate the ratio of the maximum concentration of interfering species to the concentration of the analyte, represented as Ci/Ca (Table 2).Evidently discernible from the tabulated outcomes is the absence of interference from commonly encountered cationic species during the simultaneous assessment of the analytes.Similarly, saccharine compounds encompassing glucose, sucrose, and fructose exhibited negligible impact, potentially attributed to their constrained permeability through nano-scale apertures and hindered mobility within an electrically charged milieu.Ubiquitous vitamin molecules and psychoactive agents, notably ibuprofen, ascorbic acid, and amphetamine, highly likely to be present within the urine matrix, exhibited negligible perturbation to the FFT-SWV response curve.Foremost among the interfering agents was ascorbic acid, which substantially affected MOR and UA measurements and was attributable to its active participation in electrochemical reactions upon the electrode's surface.Despite such instances, the sensor conspicuously demonstrated commendable selectivity across the comprehensive evaluation of all three analytes.

Reusability and the life-time of the electrochemical sensor
The reusability potential of the electrochemical sensor based on g-C 3 N 4 -CNT was evaluated over 12 iterative trials via the FFT-SWV methodology, employing a 5 µM solution of MOR, MET, and UA within a pH = 8  phosphate buffered saline electrolyte solution.After each measurement, the sensor was thoroughly rinsed using deionized water.The assessable metric for reusability encompassed PLS's relative predictive error, gauging the fidelity of the sensor's performance.Figure S6 depicts the FFT-SWV voltammogram, illustrating the results of the 12 measurement iterations for the analytes.PLS-based relative prediction errors for MOR, MET, and UA after completing 12 experiments were found to be 4.2%, 4.9%, and 3.7%, respectively.In fact, the reported data show the percentage of decrease in prediction accuracy.These findings firmly establish the high reproducibility of the sensor's measurements for MOR, MET, and UA, thus underscoring its superior capability for repeated use.To assess the sensor's life-time, we conducted MET concentration detection tests (targeting 5 µM MET) over seven consecutive days.The results indicated a modest 6.3% reduction in sensor response on the seventh day compared to the first day.These findings are depicted in Fig. S7.

Quantification of MOR, MET, and UA in authentic urine samples
The experimental protocol for determining MOR, MET, and UA in urine comprised the following steps: Initially, three urine samples were acquired from healthy volunteers, and each sample was subsequently bifurcated into two aliquots.The primary aliquot was subjected to the prescribed conditions as outlined below.To mitigate the presence of proteins within the urine, 20 µL of a 5 M HCl solution was incorporated into the samples, followed by a 0.2 µm filter filtration.For interference minimization and pH stabilization, a 30-fold dilution was applied to the samples using a phosphate buffer solution at pH 8, with subsequent pH adjustment to 8.This primary set of samples was prepared to establish baseline uric acid levels before introducing the analytes.Specific quantities of MOR, MET, and UA were introduced for the secondary aliquot.To eliminate proteinaceous components and macromolecules from the urine, the samples were prepared under conditions akin to those of the primary aliquots, followed by analogous dilution procedures.Employing the proposed electrochemical sensor, the direct quantification of MOR, MET, and UA in actual urine samples was investigated, employing the standard addition methodology to minimize the matrix effect.A standard solution of 5 µM from each analytes including MOR, MET, and UA was prepared.These standard solutions were then added to four volumetric flasks (VF), with different volumes of buffer added to each (ranging from 0 to VF1, 5 to VF2, 10 to VF3, and 20 to VF4).Subsequently, the solutions in each VF were diluted to 25 mL.Subsequently, the model derived from PLS was applied to determine the concentrations using the diagram obtained from the FFT-SWV technique.A calibration curve was drawn, and the concentration of the real sample was obtained by extrapolating this curve.The resultant concentrations obtained are tabulated in Table 3. Notably, each sample underwent five measurement iterations, yielding relative standard deviation (RSD) values and recovery percentages ranging from 3.71% to 5.26% and 96% to 106%, respectively.

Conclusions
This study sought to concurrently assess the presence of morphine, methadone, and uric acid utilizing a sensor based on a composite material composed of g-C 3 N 4 and CNTs integrated into a glassy carbon electrode.The g-C 3 N 4 -CNT composite was synthesized employing the solvothermal technique, incorporating functionalized CNTs.Characterization via electronic microscopies, XPS, UV-vis spectroscopy, and fluorescence analysis elucidated the composite's structure, revealing a stacking arrangement facilitated by π-π and electrostatic interactions between the CNTs and g-C 3 N 4 components.Subsequent investigations involved immobilizing and stabilizing the g-C 3 N 4 -CNT composite onto the GC electrode, leading to enhanced charge transfer and electrocatalytic performance compared to pristine CNTs in the electrooxidation processes of morphine, methadone, and uric acid.FFT-SWV, a highly sensitive electrochemical method, was employed for precise quantitative analysis of these analytes.This technique, relying on rapid Fourier transformation and noise reduction through consistent frequency application, demonstrated notably improved sensitivity.Initial assessments of each analyte using the g-C 3 N 4 -CNT-GCE platform showcased predictable linear response ranges and detection limits comparable to conventional electrochemical analysis methods.Subsequently, the challenge of overlapping signals from these analytes was addressed through partial least squares regression, effectively disentangling their signals.Validation solutions confirmed minimal errors in the predictive model, which exhibited high efficacy in analyzing real-world samples.The potential of advancing this research lies in utilizing novel materials to further enhance https://doi.org/10.1038/s41598-024-58843-9 https://doi.org/10.1038/s41598-024-58843-9

Figure 2 .
Figure 2. Physical characterization of graphitic carbon nitride (g-C 3 N 4 ) nanosheets and g-C 3 N 4 modified with carbon nanotubes (CNTs).(a) Field emission scanning electron microscopy (FESEM) images of g-C 3 N 4 and (b) g-C 3 N 4 -CNT composite.(c) Transmission electron microscopy (TEM) and (d) high-resolution TEM (HRTEM) image of g-C 3 N 4 -CNT composite.X-ray photoelectron spectroscopy (XPS) spectra of the (e) carbon and (f) nitrogen elements in the g-C 3 N 4 -CNT composite.(g) UV-vis spectrum and (h) fluorescence spectrum related to g-C 3 N 4 and g-C 3 N 4 -CNT. https://doi.org/10.1038/s41598-024-58843-9www.nature.com/scientificreports/ Figure 4c-f pertains to the investigation of frequency and amplitude influence on the initial electrochemical peak of MOR.It's evident that within the frequency range of 88 to 256 Hz and the potential range of 5 to 15 mV, the electrochemical response of the first peak's current demonstrated an upward trend.Subsequently, the response remained relatively steady from the frequency of 256 to 354 Hz and the range of 15 to 25 mV.Beyond a frequency of 354 to 564 Hz and a potential range of 25 to 30 mV, a diminishing trend emerged.Figure 4d and e delve into the impact of altering amplitude and frequency on the second electrochemical peak of MOR and the electrochemical peak of MET.These figures show that both peaks' electrochemical responses increased within the frequency range of 88 to 177 Hz and the potential range of 5 to 15 mV.The response stabilized within the

Figure 3 .
Figure 3. Electrochemical characterization of CNT-GCE and g-C 3 N 4 -CNT-GCE, both in the presence of individual biomolecules and under simultaneous exposure.Cyclic voltammetry diagrams for CNT-GCE and g-C 3 N 4 -CNT-GCE in the presence of (a) MOR, indication 2 peaks (i and ii), (b) MET with one peak (i), (c) UA with one peak (i), and (d) a mixture of MOR, MET, and UA at 5 μM concentration.

Figure 4 .
Figure 4. Optimization of specific parameters affecting the efficiency and operational performance of the g-C 3 N 4 -CNT sensor.(a) pH optimization of MOR, MET, and UA.(b) The effect of accumulation time on the electrochemical response of MOR, MET, and UA at 5 μM concentration of the analytes individually (n = 5).Optimization of frequency and amplitude in fast Fourier transform square-wave voltammetry (FFT-SWV) technique for the (c) first peak of MOR, (d) second peak of MOR, (e) MET, and (f) UA electrochemical response at 5 µM concentration and pH = 8.

Figure 5 .
Figure 5. Individual and simultaneous measurement of the target biomolecules.Univariate calibration of (a) MOR, (b) MET, and (c) UA.FFT-SWV voltammogram of the MOR, MET, and UA mixed solutions at various concentrations conducted at a frequency of 256 Hz and an amplitude of 20 mV for the (d) test and (e) training solutions.Results of calibration and validation of (f) MOR, (g) MET, and (h) UA by the partial least-squares (PLS) model.All 'training' points were repeated five times, and certain 'test' points were repeated three times.

Table 1 .
Regression equations, calibration coefficient, limit of detection, and dynamic linear range of g-C 3 N 4 -CNT-GCE electrode for individual detection of MOR, MET, and UA.

Table 2 .
Threshold concentrations ratios of diverse interfering species to 5 µM MOR, MET, and UA solution within a 0.1 M phosphate buffer (pH = 8).

Table 3 .
Recovery studies by PLS multivariable analysis of real samples in the presence of MOR and MET.www.nature.com/scientificreports/ the composite's performance and exploring non-linear multivariate calibration techniques to broaden the linear quantification range.